package demo1;

//牛客网:小易的升级之路

import java.util.Scanner;

// 注意类名必须为 demo1.Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n = in.nextLong();
        long x = in.nextLong();
        for(int i = 0; i<n; i++) {
            long a = in.nextLong();
            if(x >= a) {
                x += a;
            }else {
                x += f(x,a);
            }
        }
        System.out.println(x);
    }

    public static long f(long a, long b) {
        while(a%b!=0) {
            long t = a%b;
            a = b;
            b = t;
        }
        return b;
    }
}